package com.szrt.day20161025.crm.test;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.junit.Test;

import com.szrt.day20161025.crm.student.entity.StudentEntity;
import com.szrt.day20161025.crm.utils.GsonUtil;

/**
 * 
 * 泛型： 篮子里面可以放东西  具体放的是什么东西
 *      篮子里面可以放苹果
 *      
 *      语法：  <具体的类型>  
 *      整数：   Integer
 *      字符串： String
 *      学生：StudentEntity  具体的类
 * @author Administrator
 *
 */
public class FanXingDemo {
	
	
	@Test
	public void test01() throws Exception {
		//需求： 篮子 放组长的名字  String
		List<String>  projectLeaders = new ArrayList<String>();
		projectLeaders.add("陈杨森");
		projectLeaders.add("曹耿珲");
		projectLeaders.add("曾瑶");
		projectLeaders.add("郑智强");
		projectLeaders.add("关琛");
		projectLeaders.add("所志松");
		System.out.println(GsonUtil.toJson(projectLeaders));
		
	}
	
	
	@Test
	public void test02() throws Exception {
		//需求： 篮子 放组长的名字  String
		String[] projectLeaderArray ={"陈杨森","曹耿珲","曾瑶","郑智强","关琛","所志松"};
		List<String>  projectLeaders  = Arrays.asList(projectLeaderArray);
		System.out.println(GsonUtil.toJson(projectLeaders));
	}
	
	
	/**
	 * 重点掌握 CTRL + H
	 * @throws Exception
	 */
	@Test
	public void xfTest03() throws Exception {
		//需求： 篮子 放组长的名字  String
		
		//Integer id, String studentName, Integer age, String sex
		StudentEntity name01 = new StudentEntity(10,"郑智强",23,"男");
		StudentEntity name02 = new StudentEntity(11,"陈杨森",24,"男");
		StudentEntity name03 = new StudentEntity(12,"曹耿珲",25,"男");
		StudentEntity name04 = new StudentEntity(13,"曾瑶",20,"男");
		StudentEntity name05 = new StudentEntity(14,"关琛",16,"男");
		StudentEntity name06 = new StudentEntity(15,"所志松",26,"男");
		StudentEntity name07 = new StudentEntity(16,"李云龙",40,"男");
		
		List<StudentEntity>  projectLeaders = new ArrayList<StudentEntity>();
		projectLeaders.add(name01);
		projectLeaders.add(name02);
		projectLeaders.add(name03);
		projectLeaders.add(name04);
		projectLeaders.add(name05);
		projectLeaders.add(name06);
		
		System.out.println(GsonUtil.toJson(projectLeaders));
		
	}
	
	
	
	

}
